package com.tianqi.paypal;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.Properties;

public class UITransformer
{
	public UITransformer ()
	{}
	
	public static Properties StringToProperties (String str) throws UnsupportedEncodingException
	{
		Properties properties = new Properties();
		String[] parameter = str.split("&");
		for (int i = 0; i < parameter.length; i++)
		{
			String[] ss = parameter[i].split("=");
			if (ss.length >= 2)
			{
				properties.setProperty(ss[0], URLDecoder.decode(ss[1], "UTF-8") );
			}
		}
		return properties;
	}
}

